unit HighscoreEntryComparer;

interface

uses
  System.Collections, HighscoreEntry;

type
  THighscoreEntryComparer = class(System.Object, System.Collections.IComparer)
  private
    { Private Declarations }
  public
    constructor Create;

    function Compare(x : System.Object; y  : System.Object) : Integer;
  end;

implementation

constructor THighscoreEntryComparer.Create;
begin
  inherited Create;
  // TODO: Add any constructor code here
end;

function THighscoreEntryComparer.Compare(x: System.Object; y: System.Object) : Integer;
var
  xe : THighscoreEntry;
  xy : THighscoreEntry;

begin

  xe := x as THighscoreEntry;
  xy := y as THighscoreEntry;

  Result := xy.Score.CompareTo(xe.Score);
end;

end.
